import Vue from 'vue'
import store from './store'
import App from './App.vue'
import router, { loadRoutes } from './router'
import EventBus from './utils/EventBus';
import compiler from './components/compiler'

import svgIcon from './components/SvgIcon.vue'
Vue.component('svg-icon', svgIcon)

// 全局加载svg，不用没次都import
const req = require.context('./assets/img', false, /\.svg$/)
const requireAll = requireContent => requireContent.keys().map(requireContent)
requireAll(req)

loadRoutes(router)

import IszseDataide from './components/iszse-dataide'

Vue.use(IszseDataide)
Vue.use(EventBus)
Vue.use(compiler)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
